#!/usr/bin/env python

import math
import Image

img = Image.new('RGBA', (512, 512), (255, 255, 255, 0))
pxl = img.load()

spheresize = 512

for i in range(spheresize):
    for j in range(spheresize):
        d = math.sqrt((i - spheresize / 2.0)**2 + (j - spheresize / 2.0)**2) / (spheresize * 0.5)
        if d <= 1.0:
            pxl[i, j] = (255 * math.sqrt(1.0 - d**2), 
                         255 * math.sqrt(1.0 - d**2), 
                         255 * math.sqrt(1.0 - d**2), 
                         255 * math.sqrt(1.0 - d**2))

img.save("depth.png")
